<?php
/*echo "<pre>";
print_r($node);
echo "</pre>";*/
global $base_url;
$output = '<p class="create_head">Business Card</p><div class="card_preview" id="card_preview" style="background-image:url('.$base_url."/".path_to_theme()."/images/".$node->field_card[0]['value']."_big.gif".');">
            	<span class="card_title">'.$node->name.' <br>
                	<span>'.$node->field_company_name[0]['value'].'</span>
                </span>
                <span class="card_logo">
                	<img height="140" width="142" src="'.$base_url."/".$node->field_logo[0]['filepath'].'">
                </span>';				
				$limit = sizeof($node->field_products_services) -1;
				$count = 0;
				
				foreach($node->field_products_services as $prd)
				{
				if($count < $limit)
					{
					 $products[] = $prd['value'];
					 
					 //$output .= '<span class="card_products">'.$prd['value'].'</span>';
					 $count++;
					 }
				 
				}
				$product = @implode(",",$products);
				$output .= '<span class="card_products">'.$product.'</span>' ;
				
				
				$limit = sizeof($node->field_keywords) -1;
				$count = 0;
				$keywords = array();
				foreach($node->field_keywords as $prd)
				{
				if($count < $limit)
					{
				 $keywords[] = $prd['value'];
				 $count++;
				 }
				}
				$keyword = implode(",",$keywords);
				$output .='<span class="card_keyskills"><strong>Keyskills</strong><br>'.$keyword.'</span>';
            $output .='<span class="card_contactus">'.$node->field_contacts[0]['value'].'</span></div>';
			echo $output;
?>